const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
  // app.use(createProxyMiddleware('/api', { target: 'http://101.37.173.34:8089/', changeOrigin: true, secure: false}));
  // app.use(createProxyMiddleware('/apc', { 
  //   target: 'http://192.168.0.240:8081',
  //   secure: false,
  //   changeOrigin: true,
  //   pathRewrite: {
  //    '^/apc': ''
  //   },
  //  }));
  app.use(createProxyMiddleware('/apc', { 
    target: 'http://121.36.4.116:8033',
    secure: false,
    changeOrigin: true,
    pathRewrite: {
     '^/apc': ''
    },
   }));
//  app.use(createProxyMiddleware('/api', { target: 'http://101.37.173.34:8089/', changeOrigin: true, secure: false}));
   app.use(createProxyMiddleware('/api', { target: 'http://124.70.33.68:8033/', changeOrigin: true, secure: false}));
  // app.use(createProxyMiddleware('/api', { 
  //   target: 'http://120.78.193.28:8033/',
  //   secure: false,
  //   changeOrigin: true,
  //   pathRewrite: {
  //    '^/api': ''
  //   },
  //  }));
}; 